Skip to content

Fix an INTERNAL ERROR when creating cobertura output for namespace package#20112

Merged
ilevkivskyi merged 2 commits into
python:masterfrom
wyattscarpenter:cobcrash
Oct 27, 2025
Merged

Fix an INTERNAL ERROR when creating cobertura output for namespace package#20112
ilevkivskyi merged 2 commits into
python:masterfrom
wyattscarpenter:cobcrash

Conversation

@wyattscarpenter

@wyattscarpenter wyattscarpenter commented Oct 24, 2025

Copy link
Copy Markdown
Contributor

Fixes #19843

This fixes an Internal Error where namespace packages were not supported properly. We have to use os.path.isdir(path) instead of trying to catch an IsADirectoryError exception because of a bug on Windows which causes it to throw a PermissionError instead in the relevant situation, which makes except IsADirectoryError unreliable. (We also can't just except (IsADirectoryError, PermissionError) because what if there is an actual permission error?)

@github-actions

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@wyattscarpenter
wyattscarpenter marked this pull request as ready for review October 24, 2025 11:55

@sterliakov sterliakov left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice batch, thanks!

@ilevkivskyi
ilevkivskyi merged commit 00df9a6 into python:master Oct 27, 2025
20 checks passed
@wyattscarpenter
wyattscarpenter deleted the cobcrash branch October 27, 2025 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

INTERNAL ERROR when creating cobertura output for namespace package

3 participants